<?php
        require_once('../auth/auth.php');
        	$username= $_SESSION['SESS_MEMBER_USERNAME'];
?>


<html xmlns="http://www.w3.org/1999/xhtml">

<head>	
	
<?php 
	$page_title = "Dashboard";
	include 'patientPortalTemplate.php' 
?>	      

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<script type="text/javascript" src="assets/js/css-pop.js"></script>

</head>

<body>

	<section id="main" class="column">
<!--		
		<h4 class="alert_info">Welcome to the free MediaLoot admin panel template, this could be an informative message.</h4>
		<h4 class="alert_warning">A Warning Alert</h4>
		<h4 class="alert_error">An Error Message</h4>		
		<h4 class="alert_success">A Success Message</h4>
-->		
		<article class="module width_full">
			<header><h3>Stats</h3></header>
			<div class="module_content">
				<article class="stats_graph">
				
<table>
<tr>
	<td><img src="charts/patientsBar.php" /> </td>
	<td><img src="charts/diseaseBar.php" /></td>
</tr>
</table>											 
				</article>
				
				<article class="stats_overview">
					<div class="overview_today">
						<p class="overview_day">Your Patients</p>
						<p class="overview_count">					
							<?php 						
								include 'db/db_Connect.php';
								$result = mysql_query("SELECT * from patients WHERE readmission_risk = 'YES' AND discharged_on IS NULL and owned_by = '".$username."'");
								$count = mysql_num_rows($result);										
								echo "$count";
								include 'db/db_Close.php';											
							?>
						</p>
						<p class="overview_type">High Risk</p>
						<p class="overview_count">
							<?php 
								include 'db/db_Connect.php';
								$result = mysql_query("SELECT * from patients WHERE discharged_on IS NULL and owned_by = '".$username."'");
								$count = mysql_num_rows($result);										
								echo "$count";
								include 'db/db_Close.php';
							?>
						</p>
						<p class="overview_type">Total</p>
					</div>
				</article>
				<div class="clear"></div>
			</div>
		</article><!-- end of stats article -->
		
		<article class="module width_full">
		<header><h3 class="tabs_involved">Current Patients</h3>
		<ul class="tabs">
   			<li><a href="#tab1">High-Risk</a></li>
    		<li><a href="#tab2">All</a></li>
		</ul>
		</header>

		<div class="tab_container" >
			<div id="tab1" class="tab_content">
					<?php 						
						include 'tables/highRisk_Current.php';										
					?>	
			</div><!-- end of #tab1 -->
			
			<div id="tab2" class="tab_content">
					<?php 						
						include 'tables/all_Current.php';										
					?>	
			</div><!-- end of #tab2 -->
			
		</div><!-- end of .tab_container -->
		
		</article><!-- end of content manager article -->
		
		<div class="clear"></div>

<!--
		
		<article class="module width_full">
			<header><h3>Basic Styles</h3></header>
				<div class="module_content">
					<h1>Header 1</h1>
					<h2>Header 2</h2>
					<h3>Header 3</h3>
					<h4>Header 4</h4>
					<p>Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras mattis consectetur purus sit amet fermentum. Maecenas faucibus mollis interdum. Maecenas faucibus mollis interdum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.</p>

<p>Donec id elit non mi porta <a href="#">link text</a> gravida at eget metus. Donec ullamcorper nulla non metus auctor fringilla. Cras mattis consectetur purus sit amet fermentum. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum.</p>

					<ul>
						<li>Donec ullamcorper nulla non metus auctor fringilla. </li>
						<li>Cras mattis consectetur purus sit amet fermentum.</li>
						<li>Donec ullamcorper nulla non metus auctor fringilla. </li>
						<li>Cras mattis consectetur purus sit amet fermentum.</li>
					</ul>
				</div>
		</article><!-- end of styles article -->
		<div class="spacer"></div>
	</section>
</body>

</html>
